from django.contrib import admin
from .models import *


# Register your models here.


class UserModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'nickname', 'email', 'introduce', 'created_at', 'updated_at']
    search_fields = ['nickname', 'email']


admin.site.register(UserModel, UserModelAdmin)


class PostModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'title', 'category', 'created_at', 'updated_at', 'user', 'like_count', 'comment_count',
                    'favorite_count']
    search_fields = ['title', 'category']
    list_filter = ['category']


admin.site.register(PostModel, PostModelAdmin)


class CommentModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'content', 'created_at', 'user', 'post']
    search_fields = ['content']
    list_filter = ['user', 'post']


admin.site.register(CommentModel, CommentModelAdmin)
